<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/32x32-paimeng.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/16x16-paimeng.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css" integrity="sha256-xejo6yLi6vGtAjcMIsY8BHdKsLg7QynVlFMzdQgUuy8=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/blue/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"xuande-hk.gitee.io","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.12.3","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"shrinkIn"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="Git学习笔记">
<meta property="og:type" content="article">
<meta property="og:title" content="Git学习笔记">
<meta property="og:url" content="https://xuande-hk.gitee.io/posts/4.html">
<meta property="og:site_name" content="玄德の博客">
<meta property="og:description" content="Git学习笔记">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xuande-1309318075.cos.ap-beijing.myqcloud.com/my-blog-image/git-1.png">
<meta property="article:published_time" content="2022-12-09T09:00:00.000Z">
<meta property="article:modified_time" content="2023-03-22T06:33:26.307Z">
<meta property="article:author" content="玄德">
<meta property="article:tag" content="软件开发通用">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xuande-1309318075.cos.ap-beijing.myqcloud.com/my-blog-image/git-1.png">


<link rel="canonical" href="https://xuande-hk.gitee.io/posts/4.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://xuande-hk.gitee.io/posts/4.html","path":"/posts/4.html","title":"Git学习笔记"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Git学习笔记 | 玄德の博客</title>
  





  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">

  <!-- 看板娘 -->
  
      <script async src="/live2d/autoload.js"></script>
      <!-- <script async src="https://fastly.jsdelivr.net/gh/xuande-hk/live2d-widget/autoload.js"></script> -->
  
  
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">玄德の博客</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">不说话 装高手</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Git%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0"><span class="nav-number">1.</span> <span class="nav-text">Git学习笔记</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9B%86%E4%B8%AD%E5%BC%8F%E5%92%8C%E5%88%86%E5%B8%83%E5%BC%8F%E7%9A%84%E5%8C%BA%E5%88%AB"><span class="nav-number">1.0.1.</span> <span class="nav-text">集中式和分布式的区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E5%AE%89%E8%A3%85%E5%8F%8A%E9%85%8D%E7%BD%AE"><span class="nav-number">1.0.2.</span> <span class="nav-text">Git安装及配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE"><span class="nav-number">1.0.3.</span> <span class="nav-text">Git环境配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86"><span class="nav-number">1.0.4.</span> <span class="nav-text">Git核心知识</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E9%A1%B9%E7%9B%AE%E6%90%AD%E5%BB%BA"><span class="nav-number">1.0.5.</span> <span class="nav-text">Git项目搭建</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E5%9F%BA%E7%A1%80%E6%93%8D%E4%BD%9C"><span class="nav-number">1.0.6.</span> <span class="nav-text">Git基础操作</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C"><span class="nav-number">1.0.6.1.</span> <span class="nav-text">文件操作</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%88%86%E6%94%AF%E6%93%8D%E4%BD%9C"><span class="nav-number">1.0.6.2.</span> <span class="nav-text">分支操作</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93"><span class="nav-number">1.0.6.3.</span> <span class="nav-text">远程仓库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A0%87%E7%AD%BE%E7%AE%A1%E7%90%86"><span class="nav-number">1.0.6.4.</span> <span class="nav-text">标签管理</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E5%85%B6%E4%BB%96%E6%93%8D%E4%BD%9C"><span class="nav-number">1.0.7.</span> <span class="nav-text">Git其他操作</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="玄德"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">玄德</p>
  <div class="site-description" itemprop="description">像珍惜礼物一样，珍惜今天。</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">5</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">分类</span>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/yourname" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:yourname@gmail.com" title="E-Mail → mailto:yourname@gmail.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://space.bilibili.com/286727058" title="bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;286727058" rel="noopener" target="_blank"><i class="custom bilibili fa-fw"></i>bilibili</a>
      </span>
  </div>


  <div class="links-of-blogroll site-overview-item animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://fanyi.baidu.com/?aldtype=16047#it/zh/onmobile" title="https:&#x2F;&#x2F;fanyi.baidu.com&#x2F;?aldtype&#x3D;16047#it&#x2F;zh&#x2F;onmobile" rel="noopener" target="_blank">百度翻译</a>
        </li>
    </ul>
  </div>

        </div>
      </div>

      <!-- 自定义配置文件 -->
      <!-- 近期文章板块 -->
      
        <div class="links-of-blogroll motion-element links-of-blogroll-block">
          <div class="links-of-blogroll-title">
            <!-- modify icon to fire by szw -->
            <i class="fa fa-history fa-" aria-hidden="true"></i>
            近期文章
          </div>
          <ul class="links-of-blogroll-list">
            
            
            <li>
              <a href="/" title="" target="_blank"></a>
            </li>
            
            <li>
              <a href="/" title="" target="_blank"></a>
            </li>
            
            <li>
              <a href="/" title="" target="_blank"></a>
            </li>
            
            <li>
              <a href="/" title="" target="_blank"></a>
            </li>
            
            <li>
              <a href="/" title="" target="_blank"></a>
            </li>
            
          </ul>
        </div>
      

      <!-- canvas粒子时钟 -->
        
        <!-- canvas粒子时钟 https://www.cnblogs.com/xiaohuochai/p/6368039.html
  https://www.html5tricks.com/html5-canvas-dance-time.html
 -->
<div id="">
  <canvas id="canvas" style="width:60%;">
</div>
<script async>
(function(){
  var WINDOW_WIDTH = 820;
  		var WINDOW_HEIGHT = 250;
  		var RADIUS = 7; //球半径
  		var NUMBER_GAP = 10; //数字之间的间隙
  		var u=0.65; //碰撞能量损耗系数
  		var context; //Canvas绘制上下文
  		var balls = []; //存储彩色的小球
  		const colors = ["#33B5E5","#0099CC","#AA66CC","#9933CC","#99CC00","#669900","#FFBB33","#FF8800","#FF4444","#CC0000"]; //彩色小球的颜色
  		var currentNums = []; //屏幕显示的8个字符
  		var digit =
                  [
                      [
                          [0,0,1,1,1,0,0],
                          [0,1,1,0,1,1,0],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,0,1,1,0],
                          [0,0,1,1,1,0,0]
                      ],//0
                      [
                          [0,0,0,1,1,0,0],
                          [0,1,1,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [1,1,1,1,1,1,1]
                      ],//1
                      [
                          [0,1,1,1,1,1,0],
                          [1,1,0,0,0,1,1],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,1,1,0],
                          [0,0,0,1,1,0,0],
                          [0,0,1,1,0,0,0],
                          [0,1,1,0,0,0,0],
                          [1,1,0,0,0,0,0],
                          [1,1,0,0,0,1,1],
                          [1,1,1,1,1,1,1]
                      ],//2
                      [
                          [1,1,1,1,1,1,1],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,1,1,0],
                          [0,0,0,1,1,0,0],
                          [0,0,1,1,1,0,0],
                          [0,0,0,0,1,1,0],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,1,1,1,0]
                      ],//3
                      [
                          [0,0,0,0,1,1,0],
                          [0,0,0,1,1,1,0],
                          [0,0,1,1,1,1,0],
                          [0,1,1,0,1,1,0],
                          [1,1,0,0,1,1,0],
                          [1,1,1,1,1,1,1],
                          [0,0,0,0,1,1,0],
                          [0,0,0,0,1,1,0],
                          [0,0,0,0,1,1,0],
                          [0,0,0,1,1,1,1]
                      ],//4
                      [
                          [1,1,1,1,1,1,1],
                          [1,1,0,0,0,0,0],
                          [1,1,0,0,0,0,0],
                          [1,1,1,1,1,1,0],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,1,1,1,0]
                      ],//5
                      [
                          [0,0,0,0,1,1,0],
                          [0,0,1,1,0,0,0],
                          [0,1,1,0,0,0,0],
                          [1,1,0,0,0,0,0],
                          [1,1,0,1,1,1,0],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,1,1,1,0]
                      ],//6
                      [
                          [1,1,1,1,1,1,1],
                          [1,1,0,0,0,1,1],
                          [0,0,0,0,1,1,0],
                          [0,0,0,0,1,1,0],
                          [0,0,0,1,1,0,0],
                          [0,0,0,1,1,0,0],
                          [0,0,1,1,0,0,0],
                          [0,0,1,1,0,0,0],
                          [0,0,1,1,0,0,0],
                          [0,0,1,1,0,0,0]
                      ],//7
                      [
                          [0,1,1,1,1,1,0],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,1,1,1,0],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,1,1,1,0]
                      ],//8
                      [
                          [0,1,1,1,1,1,0],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [1,1,0,0,0,1,1],
                          [0,1,1,1,0,1,1],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,0,1,1],
                          [0,0,0,0,1,1,0],
                          [0,0,0,1,1,0,0],
                          [0,1,1,0,0,0,0]
                      ],//9
                      [
                          [0,0,0,0],
                          [0,0,0,0],
                          [0,1,1,0],
                          [0,1,1,0],
                          [0,0,0,0],
                          [0,0,0,0],
                          [0,1,1,0],
                          [0,1,1,0],
                          [0,0,0,0],
                          [0,0,0,0]
                      ]//:
                  ];

  		function drawDatetime(cxt){
  			var nums = [];

  			context.fillStyle="#005eac"
  			var date = new Date();
  			var offsetX = 70, offsetY = 30;
  			var hours = date.getHours();
  			var num1 = Math.floor(hours/10);
  			var num2 = hours%10;
  			nums.push({num: num1});
  			nums.push({num: num2});
  			nums.push({num: 10}); //冒号
  			var minutes = date.getMinutes();
  			var num1 = Math.floor(minutes/10);
  			var num2 = minutes%10;
  			nums.push({num: num1});
  			nums.push({num: num2});
  			nums.push({num: 10}); //冒号
  			var seconds = date.getSeconds();
  			var num1 = Math.floor(seconds/10);
  			var num2 = seconds%10;
  			nums.push({num: num1});
  			nums.push({num: num2});

  			for(var x = 0;x<nums.length;x++){
  				nums[x].offsetX = offsetX;
  				offsetX = drawSingleNumber(offsetX,offsetY, nums[x].num,cxt);
  				//两个数字连一块，应该间隔一些距离
  				if(x<nums.length-1){
  					if((nums[x].num!=10) &&(nums[x+1].num!=10)){
  						offsetX+=NUMBER_GAP;
  					}
  				}
  			}

  			//说明这是初始化
  			if(currentNums.length ==0){
  				currentNums = nums;
  			}else{
  				//进行比较
  				for(var index = 0;index<currentNums.length;index++){
  					if(currentNums[index].num!=nums[index].num){
  						//不一样时，添加彩色小球
  						addBalls(nums[index]);
  						currentNums[index].num=nums[index].num;
  					}
  				}
  			}
  			renderBalls(cxt);
  			updateBalls();

  			return date;
  		}

  		function addBalls (item) {
  			var num = item.num;
  			var numMatrix = digit[num];
  			for(var y = 0;y<numMatrix.length;y++){
  				for(var x = 0;x<numMatrix[y].length;x++){
  					if(numMatrix[y][x]==1){
  						var ball={
  							offsetX:item.offsetX+RADIUS+RADIUS*2*x,
  							offsetY:30+RADIUS+RADIUS*2*y,
  							color:colors[Math.floor(Math.random()*colors.length)],
  							g:1.5+Math.random(),
  							vx:Math.pow(-1, Math.ceil(Math.random()*10))*4+Math.random(),
  							vy:-5
  						}
  						balls.push(ball);
  					}
  				}
  			}
  		}

  		function renderBalls(cxt){
  			for(var index = 0;index<balls.length;index++){
  				cxt.beginPath();
  				cxt.fillStyle=balls[index].color;
  				cxt.arc(balls[index].offsetX, balls[index].offsetY, RADIUS, 0, 2*Math.PI);
  				cxt.fill();
  			}
  		}

  		function updateBalls () {
  			var i =0;
  			for(var index = 0;index<balls.length;index++){
  				var ball = balls[index];
  				ball.offsetX += ball.vx;
  				ball.offsetY += ball.vy;
  				ball.vy+=ball.g;
  				if(ball.offsetY > (WINDOW_HEIGHT-RADIUS)){
  					ball.offsetY= WINDOW_HEIGHT-RADIUS;
  					ball.vy=-ball.vy*u;
  				}
  				if(ball.offsetX>RADIUS&&ball.offsetX<(WINDOW_WIDTH-RADIUS)){

  					balls[i]=balls[index];
  					i++;
  				}
  			}
  			//去除出边界的球
  			for(;i<balls.length;i++){
  				balls.pop();
  			}
  		}
  		function drawSingleNumber(offsetX, offsetY, num, cxt){
  			var numMatrix = digit[num];
  			for(var y = 0;y<numMatrix.length;y++){
  				for(var x = 0;x<numMatrix[y].length;x++){
  					if(numMatrix[y][x]==1){
  						cxt.beginPath();
  						cxt.arc(offsetX+RADIUS+RADIUS*2*x,offsetY+RADIUS+RADIUS*2*y,RADIUS,0,2*Math.PI);
  						cxt.fill();
  					}
  				}
  			}
  			cxt.beginPath();
  			offsetX += numMatrix[0].length*RADIUS*2;
  			return offsetX;
  		}

  		var canvas = document.getElementById("canvas");
  		canvas.width=WINDOW_WIDTH;
  		canvas.height=WINDOW_HEIGHT;
  		context = canvas.getContext("2d");

  		//记录当前绘制的时刻
  		var currentDate = new Date();

  		setInterval(function(){
  			//清空整个Canvas，重新绘制内容
  			context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  			drawDatetime(context);
  		}, 50)
})();
</script>

      

      <!-- 网站运行时间 -->
           
        <div id="days"></div>

<script async language="javascript">

  function show_date_time(){
      window.setTimeout("show_date_time()", 1000);
  //    BirthDay=new Date("25/07/2022 12:00:00");
      BirthDay=new Date("07/25/2022 12:00:00");
      today=new Date();
      timeold=(today.getTime()-BirthDay.getTime());
      sectimeold=timeold/1000
      secondsold=Math.floor(sectimeold);
      msPerDay=24*60*60*1000
      e_daysold=timeold/msPerDay
      daysold=Math.floor(e_daysold);
      e_hrsold=(e_daysold-daysold)*24;
      hrsold=setzero(Math.floor(e_hrsold));
      e_minsold=(e_hrsold-hrsold)*60;
      minsold=setzero(Math.floor((e_hrsold-hrsold)*60));
      seconds=setzero(Math.floor((e_minsold-minsold)*60));
      document.getElementById('days').innerHTML="已运行"+daysold+"天"+hrsold+"时"+minsold+"分"+seconds+"秒";
  }

  function setzero(i){
      if (i<10)
      {i="0" + i};
      return i;
  }

  show_date_time();

</script>

      

    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/XuanDe-HK" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://xuande-hk.gitee.io/posts/4.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="玄德">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="玄德の博客">
      <meta itemprop="description" content="像珍惜礼物一样，珍惜今天。">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="Git学习笔记 | 玄德の博客">
      <meta itemprop="description" content="Git学习笔记">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Git学习笔记
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-12-09 17:00:00" itemprop="dateCreated datePublished" datetime="2022-12-09T17:00:00+08:00">2022-12-09</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-03-22 14:33:26" itemprop="dateModified" datetime="2023-03-22T14:33:26+08:00">2023-03-22</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index"><span itemprop="name">笔记</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

            <div class="post-description">Git学习笔记</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      <div class="post-gallery" itemscope itemtype="http://schema.org/ImageGallery">
    
    <div class="post-gallery-image">
      <img src="https://xuande-1309318075.cos.ap-beijing.myqcloud.com/my-blog-image/git-1.png" itemprop="contentUrl">
    </div>
    </div>
        <h1 id="Git学习笔记"><a href="#Git学习笔记" class="headerlink" title="Git学习笔记"></a>Git学习笔记</h1><p><strong style="color:red">图库失效，请访问以下链接阅读文章</strong></p>
<p>CSDN：<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_60700961/article/details/128256235">https://blog.csdn.net/qq_60700961/article/details/128256235</a></p>
<p>博客园：<a target="_blank" rel="noopener" href="https://www.cnblogs.com/xuande/p/16969892.html">https://www.cnblogs.com/xuande/p/16969892.html</a></p>
<p>Git是一个开源的分布式版本控制系统，可以有效、高速地处理从很小到非常大的项目版本管理。</p>
<p>在团队开发中git是必不可少的，它是目前为止最流行的<strong>版本控制</strong>工具</p>
<p>Git是免费、开源的，由Linux之父花了两周时间写出来的（人与人之间的差距怎么这么大！）</p>
<p>b站狂神：<strong>有道无术、术尚可求，有术无道、止于术！</strong></p>
<h3 id="集中式和分布式的区别"><a href="#集中式和分布式的区别" class="headerlink" title="集中式和分布式的区别"></a>集中式和分布式的区别</h3><p>除了git还有svn之类的版本控制系统，它们主要区别在于一个是分布式，一个是集中式</p>
<blockquote>
<p>分布式</p>
</blockquote>
<p>代表：Git</p>
<p>分布式版本控制系统，每个人的电脑都相当于服务器，当你拉取仓库的代码后，你的电脑就是一个完整的版本库，工作时不需要联网，所有版本都在自己的本机里，当你想把自己的代码提交到主仓库时，只需要在联网时合并推送到主仓库就可以了。</p>
<blockquote>
<p>集中式</p>
</blockquote>
<p>代表：SVN</p>
<p>集中式版本控制系统，都有一个统一的版本号，放在一个<strong>统一</strong>的服务器上，工作时把最新的版本的代码拉取到电脑上，代码完成后在把写完的代码推送到服务器上，由于所有的操作都需要服务器的支持，对网络要求比较大，而且如果服务器里的数据出了问题，那么所有的数据都会丢失，本机客户端仅保存当前版本的信息。</p>
<h3 id="Git安装及配置"><a href="#Git安装及配置" class="headerlink" title="Git安装及配置"></a>Git安装及配置</h3><blockquote>
<p>下载</p>
</blockquote>
<p>git官网下载：<a target="_blank" rel="noopener" href="https://git-scm.com/download/win%EF%BC%88%E9%80%9F%E5%BA%A6%E8%BE%83%E6%85%A2%EF%BC%8C%E4%B8%8D%E6%8E%A8%E8%8D%90%EF%BC%89">https://git-scm.com/download/win（速度较慢，不推荐）</a></p>
<p>镜像下载：<a target="_blank" rel="noopener" href="https://registry.npmmirror.com/binary.html?path=git-for-windows/">https://registry.npmmirror.com/binary.html?path=git-for-windows/</a></p>
<blockquote>
<p>安装</p>
</blockquote>
<p>下载对应版本后无脑安装即可（更改安装位置的注意一下安装位置）</p>
<p>安装完git后会在开始菜单和右键文件夹下看到对应的git程序，这是因为在刚才安装时候无脑下一步的结果，由于个人不喜欢右键菜单项多出来东西，所以这里介绍下怎么删除它</p>
<blockquote>
<p>删除右键菜单项</p>
</blockquote>
<ol>
<li><p>Win+R输入<code>regedit</code>打开注册表</p>
</li>
<li><p>进入右键菜单目录：<code>HKEY_CLASSES_ROOT\Directory\Background\shell</code></p>
</li>
<li><p>删除下面两个文件夹即可</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell</span><br><span class="line">HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui</span><br></pre></td></tr></table></figure></li>
</ol>
<h3 id="Git环境配置"><a href="#Git环境配置" class="headerlink" title="Git环境配置"></a>Git环境配置</h3><p>在安装完Git后，是需要一些全局配置的</p>
<p>这里不配置也可以，当遇到要求登陆权限的远程仓库时会让你在手动输入用户名、邮箱、以及密码</p>
<blockquote>
<p>Git配置</p>
</blockquote>
<p>列出配置的所有命令：<code>git config</code></p>
<p>设置用户名和密码：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name <span class="string">&quot;your name&quot;</span>      // 设置全局用户名</span><br><span class="line">git config --global user.email <span class="string">&quot;your email&quot;</span>    // 设置邮箱</span><br></pre></td></tr></table></figure>

<p>这里的 <code>--global</code> 为全局配置，如果要在特定的的项目中使用不同的名称，那就不使用该参数，只为当前所在仓库配置。</p>
<p>查看所有配置：<code>git config -l</code></p>
<p><img src="https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/3107/image-20221209140639112.png" alt="image-20221209140639112"></p>
<p><strong>Git相关的配置文件：</strong></p>
<ol>
<li>全局配置文件：<code>C:\Users\你的用户名\.gitconfig</code></li>
<li>系统配置文件：<code>你的安装目录\Git\etc\gitconfig</code></li>
</ol>
<h3 id="Git核心知识"><a href="#Git核心知识" class="headerlink" title="Git核心知识"></a>Git核心知识</h3><blockquote>
<p>三大区域</p>
</blockquote>
<p>git在本地分为三个区域，分别为工作区、缓存区和资源区（本地），其实还有一个远程的一个仓库区，但不在本地就不做过多解释</p>
<p><strong>工作区：</strong>平时放项目代码的地方，包括git已经管理的文件区域和新增以及修改的文件区域</p>
<p><strong>缓存区：</strong>用于临时存放改动的代码，它本质上是一个文件，把工作区的部分或者全部已经确认需要保存的文件提交至暂存区，先保存一下，如果确认好了可以直接提交到本地仓库中，如果暂时不能做决定可以暂时先放到暂存区，等待下一步操作。</p>
<p><strong>资源区：</strong>又称作版本库或仓库区，将某一个历史节点的保存文件列表当做是一个版本，这里面有你提交到所有版本的数据，其中的HEAD指针默认指向最新放入仓库的版本</p>
<p>仓库区：远程的仓库，托管代码的服务器，可以是Gitee、GitHub</p>
<blockquote>
<p>工作流程</p>
</blockquote>
<p>git的工作流程：</p>
<ol>
<li>在工具区中增加或修改文件</li>
<li>将新的版本代码添加到缓存区</li>
<li>将缓存取得文件提交到远程仓库</li>
</ol>
<p><img src="https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/3107/image-20221209151335222.png"></p>
<h3 id="Git项目搭建"><a href="#Git项目搭建" class="headerlink" title="Git项目搭建"></a>Git项目搭建</h3><blockquote>
<p>创建 Git 版本库</p>
</blockquote>
<p>首先，你需要新建一个存放版本库的目录，然后进入到该目录所在路径，然后执行：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 在当前目录新建一个Git代码库</span></span><br><span class="line">git init</span><br></pre></td></tr></table></figure>

<p>如果在目录中看到包含有<code>.git</code>的隐藏目录，那就证明创建成功</p>
<blockquote>
<p>克隆远程版本库</p>
</blockquote>
<p>将远程服务器上的仓库完全镜像一份到本地上</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 克隆一个项目和它的所有版本信息</span></span><br><span class="line">git <span class="built_in">clone</span> [url] <span class="comment"># https://gitee.com/xuande-hk/xuande-hk.git</span></span><br></pre></td></tr></table></figure>

<p>我这里克隆到是我静态博客地址，可以更该为别的地址</p>
<blockquote>
<p>分支管理</p>
</blockquote>
<p>一般情况下master主分支应当保存<strong>最稳定</strong>的代码，工作时应当在新建的dev分支上工作，当发布时把dev代码合并到主分支master上</p>
<h3 id="Git基础操作"><a href="#Git基础操作" class="headerlink" title="Git基础操作"></a>Git基础操作</h3><h4 id="文件操作"><a href="#文件操作" class="headerlink" title="文件操作"></a>文件操作</h4><blockquote>
<p>文件状态</p>
</blockquote>
<ol>
<li><p>已暂存状态（staged），表示对一个已修改文件的当前版本做了标记，使之包含在下次提交的快照，<code>git add</code>.命令可以将文件状态改为staged</p>
</li>
<li><p>已修改状态（modified），表示修改了文件，但是还没有保存到数据库中</p>
</li>
<li><p>已提交状态（committed），表示数据已经安全的保存在本地数据库中</p>
</li>
</ol>
<blockquote>
<p>管理文件命令</p>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 查看指定文件状态</span></span><br><span class="line">git status [filename]</span><br><span class="line"><span class="comment"># 查看所有文件状态</span></span><br><span class="line">git status</span><br><span class="line"></span><br><span class="line"><span class="comment"># 添加单个文件到暂存区</span></span><br><span class="line">git add [filename]</span><br><span class="line"><span class="comment"># 添加所有文件到暂存区</span></span><br><span class="line">git add .    </span><br><span class="line"></span><br><span class="line"><span class="comment"># 如果暂存区有文件，则将其中的文件提交到仓库</span></span><br><span class="line">git commit        </span><br><span class="line"><span class="comment"># 带注释提交，说明你增加或修改的内容</span></span><br><span class="line">git commit -m <span class="string">&#x27;your comments&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 查看版本库中所有的改动</span></span><br><span class="line">git diff    </span><br><span class="line"><span class="comment"># 查看具体文件的改动</span></span><br><span class="line">git diff Readme.md       </span><br><span class="line"></span><br><span class="line"><span class="comment"># 显示所有提交的历史记录</span></span><br><span class="line">git <span class="built_in">log</span>     </span><br><span class="line"><span class="comment"># 单行显示提交历史记录的内容</span></span><br><span class="line">git <span class="built_in">log</span> --pretty=oneline  </span><br><span class="line"></span><br><span class="line"><span class="comment"># 回退到上一个提交版本</span></span><br><span class="line">git reset --hard HEAD^  </span><br><span class="line"><span class="comment"># 回退到上上一个提交版本</span></span><br><span class="line">git reset --hard HEAD^^      </span><br><span class="line"><span class="comment"># 回退到未来的某个版本</span></span><br><span class="line">git reflog</span><br><span class="line"><span class="comment"># 会退到 commit_id 指定的提交版本</span></span><br><span class="line">git reset --hard <span class="string">&#x27;commit_id&#x27;</span>    </span><br><span class="line"></span><br><span class="line"><span class="comment"># 如果指定文件在工作区，则丢弃其修改</span></span><br><span class="line">git checkout -- [filename]   </span><br><span class="line"><span class="comment"># 丢弃当前目录下所有工作区中文件的修改</span></span><br><span class="line">git checkout -- . </span><br><span class="line"></span><br><span class="line"><span class="comment"># 删除已经被提交过的文件</span></span><br><span class="line">git <span class="built_in">rm</span> [filename] </span><br></pre></td></tr></table></figure>

<hr>
<h4 id="分支操作"><a href="#分支操作" class="headerlink" title="分支操作"></a>分支操作</h4><p>分支是版本控制系统中很重要的一个概念，在 Git 中新建、合并等分支的操作非常轻量便捷，因此我们会很经常的用到。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 查看本地分支信息</span></span><br><span class="line">git branch         </span><br><span class="line"><span class="comment"># 查看相对详细的本地分支信息</span></span><br><span class="line">git branch -v     </span><br><span class="line"><span class="comment"># 查看包括远程仓库在内的分支信息</span></span><br><span class="line">git branch -av     </span><br><span class="line"></span><br><span class="line"><span class="comment"># 新建一个名称为 dev 的分支</span></span><br><span class="line">git branch dev </span><br><span class="line"><span class="comment"># 新建完 dev 分支以后，通过该命令切换到 dev 分支</span></span><br><span class="line">git checkout dev </span><br><span class="line"><span class="comment"># 新建 dev 分支，并切换到该分支上</span></span><br><span class="line">git checkout -b dev </span><br><span class="line"><span class="comment"># 切换回 master 分支</span></span><br><span class="line">git checkout master   </span><br><span class="line"><span class="comment"># 合并指定分支到当前分支</span></span><br><span class="line">git merge [branch] </span><br><span class="line"></span><br><span class="line"><span class="comment"># 删除 dev 分支</span></span><br><span class="line">git branch -d dev </span><br></pre></td></tr></table></figure>

<hr>
<h4 id="远程仓库"><a href="#远程仓库" class="headerlink" title="远程仓库"></a>远程仓库</h4><p>上面的所有命令都是针对本地仓库的操作。但是当我们多个人来协作时，会将代码发布到一个统一的远程仓库，当多个人在本地操作完成以后，会推送到远程仓库。其他人协作时，需要先同步远程仓库的内容，再推送自己的修改。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># git clone 后面的仓库地址，可以支持多种协议，如 https， ssh 等。</span></span><br><span class="line">git <span class="built_in">clone</span> https://github.com/git/git.git</span><br><span class="line"><span class="comment"># 为本地仓库添加远程仓库</span></span><br><span class="line">git remote add origin your_remote_git_repo </span><br><span class="line"></span><br><span class="line"><span class="comment"># 第一次推送时使用，可以简化后面的推送或者拉取命令使用</span></span><br><span class="line">git push -u origin master </span><br><span class="line"><span class="comment"># 将本地 master 分支推送到 origin 远程分支</span></span><br><span class="line">git push origin master    </span><br><span class="line"></span><br><span class="line"><span class="comment"># 拉取远程仓库内容，但不会自动合并</span></span><br><span class="line">git fetch origin master  </span><br><span class="line"><span class="comment"># 拉取远程仓库内容，自动合并</span></span><br><span class="line">git pull origin master</span><br><span class="line"></span><br><span class="line"><span class="comment"># 查看远程仓库信息</span></span><br><span class="line">git remote [-v]</span><br><span class="line"><span class="comment"># 建立本地分支和远程分支的关联</span></span><br><span class="line">git branch --set-upstream <span class="string">&#x27;local_branch&#x27;</span> origin/remote_branch</span><br><span class="line"><span class="comment"># 修改本地仓库对应的远程仓库地址</span></span><br><span class="line">git remote set-url origin [url]</span><br></pre></td></tr></table></figure>

<hr>
<h4 id="标签管理"><a href="#标签管理" class="headerlink" title="标签管理"></a>标签管理</h4><p>在项目开发过程中，当一个版本发布完成时，是需要对代码打上标签，便于后续检索。获处于其他的原因，需要对某个提交打上特定的标签。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 创建标签</span></span><br><span class="line">git tag -a <span class="string">&#x27;tagname&#x27;</span> -m <span class="string">&#x27;comment&#x27;</span> <span class="string">&#x27;commit_id&#x27;</span></span><br><span class="line"><span class="comment"># 查看本地仓库中的所有标签</span></span><br><span class="line">git tag </span><br><span class="line"><span class="comment"># 查看具体标签信息</span></span><br><span class="line">git show tagname</span><br><span class="line"><span class="comment"># 删除本地标签</span></span><br><span class="line">git tag -d tagname</span><br><span class="line"></span><br><span class="line"><span class="comment"># 推送标签到远程仓库</span></span><br><span class="line">git push origin tagname</span><br><span class="line"><span class="comment"># 推送所有标签到远程仓库</span></span><br><span class="line">git push origin --tags</span><br><span class="line"><span class="comment"># 删除远程标签</span></span><br><span class="line">git push origin --delete tagname</span><br></pre></td></tr></table></figure>

<h3 id="Git其他操作"><a href="#Git其他操作" class="headerlink" title="Git其他操作"></a>Git其他操作</h3><blockquote>
<p>绑定IDEA</p>
</blockquote>
<p>IDEA版本2021.3.2</p>
<p>git版本：2.36.0</p>
<p>操作系统：win10</p>
<p>打开idea，找到vcs，创建仓库</p>
<p><img src="https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/3107/image-20221209163210278.png" alt="image-20221209163210278"></p>
<p>创建以后vcs会变成git，点击git后找到管理远程</p>
<p><img src="https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/3107/image-20221209163350044.png" alt="image-20221209163350044"></p>
<p>添加远程仓库的地址（没有的话去gitee或者github建一个仓库）</p>
<p><img src="https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/3107/image-20221209163501172.png" alt="image-20221209163501172"></p>
<p>之后点击提交就可以了（需要输入提交信息）</p>
<p><img src="https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/3107/image-20221209163554028.png" alt="image-20221209163554028"></p>
<p>注：控制台输入命令也可以实现</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div>坚持原创技术分享，感谢您的支持和鼓励</div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wechatpay.png" alt="玄德 微信">
        <span>微信</span>
      </div>
      <div>
        <img src="/images/alipay.png" alt="玄德 支付宝">
        <span>支付宝</span>
      </div>

  </div>
</div>

          <div class="followme">
  <span>欢迎关注我的其它发布渠道</span>

  <div class="social-list">

      <div class="social-item">
        <a target="_blank" class="social-link" href="/images/wechat_channel.jpg">
          <span class="icon">
            <i class="fab fa-weixin"></i>
          </span>

          <span class="label">WeChat</span>
        </a>
      </div>
  </div>
</div>

          <div class="post-tags">
              <a href="/tags/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E9%80%9A%E7%94%A8/" rel="tag"># 软件开发通用</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/posts/3.html" rel="prev" title="DC-9靶场笔记">
                  <i class="fa fa-chevron-left"></i> DC-9靶场笔记
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/posts/5.html" rel="next" title="《golong入门教程📚》，从零开始入门❤️（建议收藏⭐️）">
                  《golong入门教程📚》，从零开始入门❤️（建议收藏⭐️） <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 2022 – 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">玄德</span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="我的第 undefined 位朋友，">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="历经 undefined 次回眸才与你相遇">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>

    </div>
  </footer>

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  
<script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.0/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/pace.js"></script>

  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>






  <script async src="/js/cursor/love.min.js"></script>


</body>
</html>
